window.addEventListener('load', function () {
    //获取返回顶部
    var goTop = document.querySelector('.goTop');
    var part1 = document.querySelector('.part1')
    //第一部分到顶部的距离
    var part1Top = part1.offsetTop
    //返回顶部移动的距离=返回顶部到顶部的距离-第一部分到顶部的距离
    document.addEventListener('scroll', function () {
        if (window.pageYOffset >= part1Top) {
            goTop.style.display = 'block'
            // goTop.style.position = 'fixed'
            goTop.style.top = window.pageYOffset + 380 + 'px'
            goTop.style.transition = 'all .5s'
        } else {
            goTop.style.display = 'none'

        }

    })



    // var galleryThumbs = new Swiper('.gallery-thumbs', {
    //     spaceBetween: 10,
    //     slidesPerView: 4,
    //     loop: true,
    //     freeMode: true,
    //     loopedSlides: 5, //looped slides should be the same
    //     watchSlidesVisibility: true,
    //     watchSlidesProgress: true,
    // });
    // var galleryTop = new Swiper('.gallery-top', {
    //     spaceBetween: 10,
    //     loop: true,
    //     loopedSlides: 5, //looped slides should be the same
    //     navigation: {
    //         nextEl: '.rightBtn',
    //         prevEl: '.leftBtn',
    //     },
    //     thumbs: {
    //         swiper: galleryThumbs,
    //     },
    // });

})
$(function(){
    var num = 0;
    $('.rightBtn').click(function(){ 
        if(num == 0){
            num =5;
            $('.wrap p').eq(num).show().siblings('p').hide();
        } else {
            num--;
            $('.wrap p').eq(num).show().siblings('p').hide();
        } 
        $('.img-zs-txt').html(num+1);
    })
    // 右侧按钮
    $('.leftBtn').click(function(){
        if(num == 5){
            num =0;
            $('.wrap p').eq(num).show().siblings('p').hide();
        } else {
            num++;
            $('.wrap p').eq(num).show().siblings('p').hide();
        }
        $('.img-zs-txt').html(num+1);
    })
    // 点击右侧按钮
    // 获取图片总长度，设置在页面结构上
    $('.sum-img-zs-txt').html($('.big-img-list .swiper-slide-wsq').length-2)
    // console.log($('.big-img-list .swiper-slide-wsq').length);


})
